package org.geektimes.projects.user.web.listener;

import org.geekbang.projects.config.ConfigContext;
import org.geekbang.projects.injection.ApplicationContext;
import org.geekbang.projects.injection.ApplicationContextCompleteAware;
import org.geekbang.projects.injection.processor.EnvironmentAware;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * 测试用途
 */
@Deprecated
public class Testing implements ApplicationContextCompleteAware  , EnvironmentAware {

	private Logger logger = Logger.getLogger(this.getClass().getName());


	private ConfigContext configContext;

	@Override
	public void onComplete(ApplicationContext applicationContext) {
		logger.log(Level.INFO, "测试配置值:" + configContext.getValue("testValue", Integer.class));
		logger.log(Level.INFO, "测试配置值:" + configContext.getValue("application.name", String.class));
	}

	@Override
	public void setEnvironment(ConfigContext configContext) {
		this.configContext = configContext;
	}
}
